package cn.com.jd.controller;

import java.io.IOException;
import java.sql.Date;
import java.util.HashMap;
import java.util.Map;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;

import net.sf.json.JSONObject;
import net.sf.json.JsonConfig;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import cn.com.jd.common.JsonDateValueProcessor;
import cn.com.jd.service.CheckAcceleratableService;

@Controller
public class CheckAcceleratableController {

	private static Logger logger = Logger.getLogger(RegLogInController.class);
	@Resource
	private CheckAcceleratableService checkAcceleratableService;
	
	@RequestMapping(value = "/checkAcceleratable", method = RequestMethod.GET) 
	String checkAcceleratable(@RequestParam("id") String id,HttpServletResponse response) throws IOException{
		String result = "0";
		if(id != null){
			result = checkAcceleratableService.checkAcceleratableService(id);
		}
		Map<String,Object> map = new HashMap<String,Object>();    
	    map.put("result", result);
	    String json = JSONObject.fromObject(map).toString();          
	    //将数据返回  
	    response.setCharacterEncoding("UTF-8");
	    response.flushBuffer();
        response.getWriter().write(json);  
        response.getWriter().flush();    
        response.getWriter().close();
		return null;
	}
}
